package com.jojo.android.zxlib.base;

import android.content.Context;

import java.util.List;

/**
 * @Author ZXW
 * @Date 2020/8/7 15:33
 **/
public abstract class BaseListAdapter<D> extends android.widget.BaseAdapter {
    protected Context context;
    protected List<D> data;
    public BaseListAdapter(Context context){
        this.context = context;
    }

    public void setData(List<D> data){
        this.data = data;
    }

    @Override
    public int getCount() {
        if (data == null)return 0;
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return data.get(position);
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }





}
